<template>
	<view class="shopCart">
		<view class="shopCart-content">
			<view class="shopCart-content--left" @click="onShowCartList">
				<view class="num-info">
					<image class="img" src="https://mini-program-1251317796.file.myqcloud.com/menu/cart_icon.png" mode=""></image>
					<view class="num" v-if="cartTotalNum!==0">{{cartTotalNum}}</view>
				</view>
				<view class="money-info">
					<view class="price-info">
						<text class="text">总计</text>
						<text class="price">{{order.cartProductFeeTotal}}</text>
					</view>
					<view class="economy" v-if="order.cartProductDiscount">
						已为你节省 <text class="p">{{order.cartProductDiscount}}</text> 元
					</view>
				</view>
			</view>
			<template v-if='isCanOrder'>
				<view :class="diningMode==='wx_out' && !isMeetOut ? 'ban-btn shopCart-content--right l-btn btn-primary':'shopCart-content--right l-btn btn-primary'"
				 @click.stop="onTapBtn">
					<view class="up-txt">去结算</view>
					<view class="under-txt" v-if="diningMode==='wx_out'">实付{{currentStoreInfo.start_fee}}元起送</view>
				</view>
			</template>
			<template v-else>
				<view class="ban-btn shopCart-content--right l-btn btn-primary">
					<view class="up-txt">不可下单</view>
				</view>
			</template>
		</view>

		<!-- 展示购物车列表 -->
		<template v-if="isShowCart">
			<view class="mask-screen" @click="onHideCartList"></view>
			<view class="cart-list-wrap">
				<view class="cart-list-header">
					<view class="cart-list-header--txt">购物车</view>
					<view class="cart-list-header--del" @click.stop="clearCartList">
						<text class="iconfont icon-shanchu"></text>清空
					</view>
				</view>
				<scroll-view class="cart-list-scroll" scroll-y scroll-with-animation>
					<cart-list></cart-list>
				</scroll-view>
			</view>
		</template>
	</view>
</template>

<script>
	import data from './shopping-cart.js';
	export default data;
</script>

<style lang="less" scoped>
	@import '~@/common/styles/common.less';
	@import './shopping-cart.less';
</style>
